package edu.nf.api.controller.shop;

import edu.nf.api.controller.BaseController;
import edu.nf.meituan.service.shop.impl.ShopServiceDaoImpl;
import org.nf.web.annotation.RequestMapping;
import org.nf.web.annotation.RequestParam;
import org.nf.web.servlet.View;
import org.nf.web.servlet.view.JsonView;


/**
 * @Date 2023-06-20
 * @Author qiu
 * 用户入住商家控制器
 */
public class RegisterShopController extends BaseController {

    /**
     *
     * @param typeId 类型编号
     * @param uid 用户 id
     * @param shopName 商家名称
     * @param shopPhone 商家电话
     * @param shopAddress 商家地址
     * @param key  验证码
     * @return
     */
    @RequestMapping("/shop/registerShop")
    public View registerShop(@RequestParam("typeId") int typeId,
                             @RequestParam("uid") int uid,
                             @RequestParam("shopName") String shopName,
                             @RequestParam("shopPhone") String shopPhone,
                             @RequestParam("shopAddress") String shopAddress,
                             @RequestParam("key") String key) {

        int row = new ShopServiceDaoImpl().registerShop(typeId, uid, shopName, shopPhone, shopAddress, key);

        return new JsonView(row);
    }

}
